<%@ Page  Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="cHead" ContentPlaceHolderID="cphHead" runat="server">
    <% this.Page.Title = (string)ViewData["PageTitle"]; %>
</asp:Content>

<asp:Content ID="cJScripts" ContentPlaceHolderID="cphJScripts" runat="server">
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;language=<%= (string)ViewData["GMapLang"] %>"></script>
    <%= Html.CombresLink("gmapJS") %>

    <script type="text/javascript">
        var section = '<%= (string)ViewData["SystemName"] %>';
        var errorMsg = '<%= (string)ViewData["ErrorMessage"] %>';
        var defaultLat = <%= (string)ViewData["DefaultLat"] %>;
        var defaultLng = <%= (string)ViewData["DefaultLng"] %>;
        var defaultZoom = <%= (string)ViewData["DefaultZoom"] %>;
        var displayTools = <%= (UsersRepository.GetUserType((string)ViewData["SystemName"]) != UserType.User).ToString().ToLower() %>;

        <% if (UsersRepository.GetUserType((string)ViewData["SystemName"]) != UserType.User){ %>
        function DeleteAlert(id, index){
            $.colorbox({ href : "/<%= (string)ViewData["SystemName"]%>/Camps/Delete/" + id + "?index=" + index,  width: "400px", height: "150px", iframe: true });
        }

        function DeleteMarker(id, index)
        {
            $.ajax({
                url: "/<%= (string)ViewData["SystemName"]%>/Camps/Delete/" + id,
                type: "POST",
                data: { Index : index },
                success: function(result){
                    gmarkers[result].setMap(null);
                }
            });
        }
        <% } %>

        $(document).ready(function() {
            GetMap();
            $('#infoBread a').colorbox({ width: "400px", height: "350px", scrolling: false, iframe: true, title: "Liste des camps" });        
        })
    </script>
</asp:Content>

<asp:Content ID="cBreadCrumb" ContentPlaceHolderID="cphBreadCrumb" runat="server">
    <div id="infoBread">
        <%= Html.ActionLink("Liste des camps", "List", new { controller = "Camps", systemName = (string)ViewData["SystemName"] }, new { title = "Liste des camps" })%>
    </div>
</asp:Content>

<asp:Content ID="cMainContent" ContentPlaceHolderID="cphMainContent" runat="server">
    <div id="mapCamp">
        <div id="mapContainer"></div>
        <div class="loader"></div>
    </div>
</asp:Content>

<asp:Content ID="cAdminMenu" runat="server" ContentPlaceHolderID="cphAdminMenu">
    <% if ((UserType)ViewData["UserType"] == UserType.Moderator || (UserType)ViewData["UserType"] == UserType.Administrator) {  %>
    <ul id="adminMenu">
        <li class="create"><%= Html.ActionLink(ScoutNET.Resources.Camps_Index_CreateLink, "Create", new { controller = "Camps", systemName = (string)ViewData["SystemName"] })%></li>      
    </ul>
    <% } %>
</asp:Content>

